﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Description;

namespace LostLib.Clouds
{
	class CloudsMain
	{
		public static Uri BaseAddress = new Uri("http://localhost:13555/LostClouds");

		static void Main(string[] args)
		{
			var node = new ServerNode();
			var host = new ServiceHost(node, BaseAddress);

			host.AddServiceEndpoint(typeof(IServerNode), new WSHttpBinding(), "Manager");

			var medatadaBehavior = new ServiceMetadataBehavior();
			medatadaBehavior.HttpGetEnabled = true;
			host.Description.Behaviors.Add(medatadaBehavior);

			host.Open();

			Console.WriteLine("The service is ready.");
			Console.WriteLine("Press <ENTER> to terminate service.");
			Console.WriteLine();
			Console.ReadLine();

			host.Close();
		}
	}
}
